package com.pinapel.aixml.controller.Editor;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;

import com.pinapel.aixml.controller.IEditorsController;
import com.pinapel.aixml.controller.IMainController;
import com.pinapel.aixml.models.Model;
import com.pinapel.aixml.models.xml.TextModel;
import com.pinapel.aixml.ui.editors.EditorTextMode;

@Deprecated
public class TextEditorController implements ITextEditorController{

	private EditorTextMode mView;
	private IEditorsController mEditorsController;
//	private TextModel mTextModel;
	
	public TextEditorController(IEditorsController top){
		mEditorsController = top;
//		mTextModel = new TextModel();
	}
	
	@Override
	public void loadText(String theText) {
		mView.setText(theText);
//		mTextModel.setText(theText);
	}

	@Override
	public void setView(EditorTextMode view) {
		mView = view;
//		mView.setController(this);
	}

	@Override
	public String getText() {
		return new String (mView.getText());
	}

	@Override
	public IMainController getMainController() {
		return mEditorsController.getMainController();
	}

	@Override
	public RSyntaxTextArea getRSyntaxTextArea() {
		return mView.getTextArea();
	}

	@Override
	public Model getModel() {
		return this.getMainController().getModel();
	}
}
